package edu.pku.sei.modeler.uml.commands.deployment;

import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.uml.Artifacts.Artifact;
import edu.pku.sei.modeler.uml.commands.NestedElementDeleteCommand;

public class NestedArtifactElementDeleteCommand extends
		NestedElementDeleteCommand {
	private Artifact father;
	private Artifact child;
	public NestedArtifactElementDeleteCommand(MetaNode node,
			MetaNode fatherNode, boolean isDeletedFromDiagram) {
		super(node, fatherNode, isDeletedFromDiagram);
		father = (Artifact) fatherNode.getModelElement();
		child = (Artifact) node.getModelElement();
	}
	@Override
	protected void deleteModelElement() {
		father.getNestedArtifact().remove(child);
	}
	
	@Override
	protected void undoDeleteGraphNode() {
		father.getNestedArtifact().add(child);
	}

}
